package com.guyu.common.web.config.properties;

import lombok.Data;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;


@Data
@AutoConfiguration
@ConfigurationProperties(prefix = "guyu.web")
public class GuyuWebProperties {

    /**
     * 请求缓存
     */
    private Boolean contentCaching = false;

    /**
     * 请求日志
     */
    private RequestLog requestLog = new RequestLog();

    @Data
    public static class RequestLog {
        /**
         * 是否开启请求日志
         */
        private Boolean enabled = true;
        /**
         * 是否开启请求返回体日志
         */
        private Boolean printRequestBody = false;
        /**
         * 是否开启请求返回体日志
         */
        private Boolean printResponseBody = false;
        /**
         * 需要打印的header
         */
        private List<String> headers = new ArrayList<>();
        /**
         * 需要排除的url
         */
        private Set<String> excludeUrl = new HashSet<>();
    }

}
